package com.example.service.Imp;

import com.example.common.b_pojo.BAdminRole;
import com.example.dao.mapper.BAdminRoleMapper;
import com.example.service.BAdminRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BAdminRoleServiceImp implements BAdminRoleService {

    @Autowired
    private BAdminRoleMapper bAdminRoleMapper;

    @Override
    public boolean deleteAdminRole(Long id, Long roleId) {
        boolean b = bAdminRoleMapper.deleteByAdminIdAndRoleId(id, roleId);
        return b;
    }

    @Override
    public boolean insertAdminRole(Long id, Long roleId) {
        if (id != null && roleId != null) {
            BAdminRole bAdminRole = new BAdminRole(id, roleId);
            int insert = bAdminRoleMapper.insert(bAdminRole);
            return insert > 0;
        }
        return false;
    }

    @Override
    public int updateAdminRole(Long id) {
        return 0;
    }

    @Override
    public int deleteAdminRoleByAdminId(Long id) {
        return 0;
    }

    @Override
    public int insertAdminRoleByAdminId(Long id) {
        return 0;
    }

    @Override
    public int updateAdminRoleByAdminId(Long id) {
        return 0;
    }
}
